<template>
    <div>
        <button-render :buttonsData="buttons" @formCommHandler="formCommHandler"></button-render>
        <edit-table v-bind="tableParams" ref="table" @selectionChange="tableSelect">
            <template #table_before>
                <slot name="table_before_son"></slot>
            </template>
            <template #table_after>
                <slot name="table_after_son"></slot>
            </template>  
        </edit-table>
    </div>
</template>
<script>
import EditTable from '@/components/baseComponents/EditTable'
import ButtonRender from '@/components/baseComponents/ButtonRender'
export default {
    name: 'ParentChildTemplate',
    props:{
        tableParams:{
            type: Object,
            default: ()=>{}
        },
        buttons:{
           type: Object,
            default: ()=>{} 
        }
    },
    components:{
        EditTable,
        ButtonRender
    },
    data() {
        return {
            
        }
    },
    methods:{
        formCommHandler(data){
            this.$emit("formCommHandler",data);
        },
        tableSelect(selection){
            this.$emit("selectionChange",selection)
        }
    }
}
</script>